package com.java1412.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author java1412
 * @create 2021-05-13 11:54
 */
@Controller
public class HelloController {

    @RequestMapping(value = "/")
    public String index(ModelMap map) {
        // 添加一个属性，用来在模板中根据这个key来读取对应的值
        map.addAttribute("msg", "Thymeleaf大爷，你好");
        // return模板文件的名称--->对应src/main/resources/templates/index.html
        return "index";
    }
}
